package bTree.LeetCode;

public class 反转链表 {
    public ListNode reverseList(ListNode head) {
        if (null==head)return head;
        ListNode left = head;
        ListNode right = head.next;
        head.next=null;
        while (null!=right){
            ListNode next = right.next;
            right.next=left;
            left=right;
            right=next;
        }
        return left;
    }
}
